package ua.epam.muzalevskiy.traction.user;

/**
 * <code>User</code> is abstract class that describe every user of web application.
 *
 * @author Muzalevskiy Vitaliy
 */
public abstract class User {
    /** User identifier.*/
    protected int id;
    /** User login name.*/
    protected String name;
    /** User password to login in system.*/
    protected String password;
    /** User email.*/
    protected String email;

    /**
     * Constructor that include all parameters of user.
     */
    public User(int id, String name, String password, String email) {
        this.id = id;
        this.name = name;
        this.password = password;
        this.email = email;
    } 
    
    /**
     * Current constructor does not include id parameter.
     */
    public User(String name, String password, String email) {
        this.name = name;
        this.password = password;
        this.email = email;
    } 
    
    /**
     * @return type of current user.
     */
    public abstract String getUserType();

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @return the password
     */
    public String getPassword() {
        return password;
    }

    /**
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    @Override
    public String toString() {
        return "[" + "name=" + name + ", password=" + password + ", email=" + email + ']';
    }

    /**
     * @return the id
     */
    public int getId() {
        return id;
    }
    
}
